package com.example.layoutdesign.Model;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import android.text.format.DateFormat;
 

public class ChatHistory {

	private long chatHistoryID;
	private String Text;
	private Date dateTime;
	
	public long getChatHistoryID(){
		return this.chatHistoryID;
	}

	public void setChatHistoryID(long ID)
	{
		this.chatHistoryID = ID;
	}
	
	public String getText(){
		return this.Text;
	}

	public void setText(String text)
	{
		this.Text = text;
	}
	
	public Date getDateTime(){
		return this.dateTime;
	}

	public void setDateTime(Date d) {
		this.dateTime = d;
	}
	
	public void setDateTime(String d){

	    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/mmm/yyyy hh:mm:ss aa");

		try {
			this.dateTime = dateFormat.parse(d);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public String toString()
	{
		return this.getText() + " " + this.dateTime.toString();
	}
}
